using Volo.Abp.Application.Dtos;
using System.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
//using {{namespaceDomainSharedEnums}};

namespace {{namespace}}
{
    /// <summary>
    /// {{classDescription}}
    /// </summary>
    public class {{className}} : IValidatableObject
    {
        {% for property in properties %}
        /// <summary>
        /// {{property.propertyDescription}}
        /// </summary>
        public {{property.propertyTypeName}} {{property.propertyName}} {get;set;}
        {% endfor %}

        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            {% for property in properties %}
            {% if property.propertyTypeName == "String" %}
            if (string.IsNullOrWhiteSpace({{property.propertyName}}))
            {
                yield return new ValidationResult("请填写{{property.propertyDescription}}", new string[] { nameof({{property.propertyName}}) });
            }{% endif %}{% endfor %}
            
            if (false)
            {
                yield return new ValidationResult("生成代码", new string[] { "" });
            }
            
        }
    }
}